Denizen Script Language Explanations


Language Explanations explain components of Denizen in a more direct and technical way than The Beginner's Guide.


Showing 1 out of 83 language explanations...
NameScript Formats
DescriptionScript formats provide the formats certain commands within that script will use for their texts. Most notably, this includes Command:debug.
See specific command's documentation for information on which formats they use (for example, the 'debug' command supports a 'debug' format and an 'error' format).
The formats are specified under a 'formats' key, and can be either Language:Format Script Containers or a direct format with the same syntax as format scripts.
When specifying a direct format, use the format name as the key; When specifying a format script, use '<format>_script' as the key (see example below).

my_project_task:
    type: task
    formats:
        # A direct format
        debug: [MyProject] <[text]>
        # A separate format script
        error_script: my_project_error
    script:
    - if <util.real_time_since_start.in_hours> > 20:
        # Will be formatted by the 'my_project_error' format script.
        - debug error "The system has been running for over 20 hours! Please restart!"
    - else:
        # Will print "[MyProject] The system does not need a restart yet."
        - debug "The system does not need a restart yet."
GroupScript Container System
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/ScriptFormattingContext.java#L20